#!/usr/bin/python
#
# Copyright (C) 2008 rambla.be
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

try:
  from xml.etree import cElementTree as ElementTree
except ImportError:
  try:
    import cElementTree as ElementTree
  except ImportError:
    from elementtree import ElementTree

import ratom
import rawsc
from rawsc import RAWS_NAMESPACE

class Name(rawsc.RawsBaseElement):
    """The RASS name element"""
    _tag = 'name'

def NameFromString(xml_string):
    return ratom.CreateClassFromXMLString(Name, xml_string)


class Size(rawsc.RawsBaseElement):
    """The RASS size element"""
    _tag = 'size'

def SizeFromString(xml_string):
    return ratom.CreateClassFromXMLString(Size, xml_string)


class Updated(rawsc.RawsBaseElement):
    """The RASS updated element"""
    _tag = 'updated'

def UpdatedFromString(xml_string):
    return ratom.CreateClassFromXMLString(Updated, xml_string)


class Mimetype(rawsc.RawsBaseElement):
    """The RASS mimetype element"""
    _tag = 'mimetype'

def MimetypeFromString(xml_string):
    return ratom.CreateClassFromXMLString(Mimetype, xml_string)

class Tag(rawsc.RawsBaseElement):
    """The RASS tag element"""
    _tag = 'tag'

    def __init__(self, text=None, extension_elements=None,
      extension_attributes=None):
        self.text = text
        self.extension_elements = extension_elements or []
        self.extension_attributes = extension_attributes or {}

def TagFromString(xml_string):
  return ratom.CreateClassFromXMLString(Tag, xml_string)

class Meta(rawsc.RawsBaseElement):
    """The RASS tag element"""
    _tag = 'meta'
    _attributes = {}
    _attributes['vocab'] = 'vocab'
    _attributes['meta_name'] = 'meta_name'
    _attributes['lang'] = 'lang'

    def __init__(self, text=None, vocab = None, meta_name = None, lang = None, attrs = None, extension_elements=None,
        extension_attributes=None):
      self.text = text
      self.vocab = vocab
      self.meta_name = meta_name
      self.lang = lang
      self.extension_elements = extension_elements or []
      self.extension_attributes = extension_attributes or {}

def MetaFromString(xml_string):
    return ratom.CreateClassFromXMLString(Meta, xml_string)


class Username(rawsc.RawsBaseElement):
    _tag = 'username'

def MethodFromString(xml_string):
    return ratom.CreateClassFromXMLString(Username, xml_string)


class FirstName(rawsc.RawsBaseElement):
    _tag = 'first_name'

def MethodFromString(xml_string):
    return ratom.CreateClassFromXMLString(FirstName, xml_string)


class LastName(rawsc.RawsBaseElement):
    _tag = 'last_name'

def MethodFromString(xml_string):
    return ratom.CreateClassFromXMLString(LastName, xml_string)


class Email(rawsc.RawsBaseElement):
    _tag = 'email'

def MethodFromString(xml_string):
    return ratom.CreateClassFromXMLString(Email, xml_string)


class Password(rawsc.RawsBaseElement):
    _tag = 'password'

def MethodFromString(xml_string):
    return ratom.CreateClassFromXMLString(Password, xml_string)


class Description(rawsc.RawsBaseElement):
    """The RASS description element"""
    _tag = 'description'

def DescriptionFromString(xml_string):
    return ratom.CreateClassFromXMLString(Description, xml_string)


class XmlNamespace(rawsc.RawsBaseElement):
    """The RASS xml_namespace element"""
    _tag = 'xml_namespace'

def XmlNamespaceFromString(xml_string):
    return ratom.CreateClassFromXMLString(XmlNamespace, xml_string)
